package com.lqw.wechat.service.replymessage.impl;

import com.lqw.wechat.dao.ReplyMessageMapper;
import com.lqw.wechat.entity.ReplyMessage;
import com.lqw.wechat.service.replymessage.ReplyMessageService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by luqiwen on 2017/7/29.
 */
@Service
public class ReplyMessageServiceImpl implements ReplyMessageService {

    private static final Logger LOGGER= LoggerFactory.getLogger(ReplyMessageServiceImpl.class);

    @Autowired
    private ReplyMessageMapper replyMessageMapper;

    @Override
    public ReplyMessage getMessageByEvent(String event) {
        if(StringUtils.isEmpty(event)){
            return null;
        }
        return replyMessageMapper.getMessageByEvent(event);
    }

    @Override
    public ReplyMessage getMessageByKeyWord(String keyWord, String msgType) {
        if(StringUtils.isEmpty(keyWord) || StringUtils.isEmpty(msgType)){
            return null;
        }
        return replyMessageMapper.getMessageByKeyWord(keyWord, msgType);
    }
}
